package ferp.core.mode;

import ferp.core.calc.Calculator;
import ferp.core.game.Game;
import ferp.core.game.Settings;
import ferp.core.player.Player;
import ferp.core.player.Profile;

/**
 * User: olegs
 * Date: 19/05/11 15:11
 */
public class Tricking10 extends TrickingBase
{
  @Override
  public int initialize(Game.Listener listener, Profile profile, Game g, Settings settings) throws Game.Error
  {
    int r = super.initialize(listener, profile, g, settings);

    g.type = Game.Type.OPEN;

    return r;
  }

  @Override
  public Player mover(Game g, Settings settings, int current)
  {
    return g.declarer() == g.human() || current == g.player.declarer ? g.current() : g.human();
  }

  @Override
  public void score(Game g, Settings settings)
  {
    Calculator.get(settings.gameFlavor).tricking10(g, settings);

    super.score(g, settings);
  }
}
